package com.qhhc.service.impl;

import com.qhhc.entity.CarOwner;
import com.qhhc.mapper.CarOwnerMapper;
import com.qhhc.service.ICarOwnerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CarOwnerService implements ICarOwnerService {
    @Autowired
    private CarOwnerMapper carOwnerMapper;

    @Override
    public void insertCarOwner(CarOwner carOwner) {
        carOwnerMapper.insertCarOwner(carOwner);
    }

    @Override
    public List<CarOwner> selectAll() {
        return carOwnerMapper.selectAllCarOwners();
    }

    @Override
    public void updateCarOwner(CarOwner carOwner) {
        carOwnerMapper.updateCarOwner(carOwner);
    }

    @Override
    public void deleteCarOwner(Long ownerId) {
        carOwnerMapper.deleteCarOwner(ownerId);
    }

    @Override
    public CarOwner selectById(Long id) {
        CarOwner carOwner = carOwnerMapper.selectCarOwnerByIdv2(id);
        return carOwner;
    }
}
